/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fyx.web.context;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import javax.faces.application.FacesMessage;
import org.fyx.mula.ejb.IsoLanguage;
import org.fyx.secure.entity.SecureUser;
import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.model.MenuModel;

/**
 * Trida zodpovidajici za spravne uchovani informaci o konkretnim kontextu
 * uzivatele. Podleha navrhovemu vzoru prepravka. Je ulozena v session
 * pod klicem {@link WebContext#SESSION_KEY}.
 * <p>
 * Dokumentace k jednotlivym atributum tridy je napsana v jendotlivych
 * metodach tridy {@link WebContext}.
 * 
 * @author xljan
 * @since FYX 1.0
 */
class Session {
    private Map<String, MenuItem> mapMenuItems = new HashMap<String, MenuItem>();
    private Map<String, MenuItem> mapAllMenuItems = new HashMap<String, MenuItem>();
    private SecureUser user = new SecureUser();
    private String isoLanguage = IsoLanguage.CZE;
    private String baseUrl = "http://rc1.makrobioklub.cz/";
    private String baseNoFacesUrl = "http://rc1.makrobioklub.cz/FyxWeb/";
    private String skinPatch = "/skin/default/";
    private String skinUrl = baseUrl + "faces/skin/default/";
    private String skin0Culomns = skinPatch + "0_culomn.xhtml";
    private String tplPatch = "/templates/";
    private String tplUrl = baseUrl + "faces/templates/";
    private boolean logedIn = false;
    private final Collection<FacesMessage> messages = new LinkedList<FacesMessage>();
    private Set<String> roles = new HashSet<String>();
    private MenuModel menuModel = null;
    private String currentUrl = "";

    public Map<String, MenuItem> getMapMenuItems() {
        return mapMenuItems;
    }

    public Map<String, MenuItem> getMapAllMenuItems() {
        return mapAllMenuItems;
    }
    
    public SecureUser getUser() {
        return user;
    }

    public void setUser(SecureUser user) {
        this.user = user;
    }

    public Set<String> getRoles() {
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    public boolean isLogedIn() {
        return logedIn;
    }

    public void setLogedIn(boolean isLogedIn) {
        this.logedIn = isLogedIn;
    }
    
    public String getIsoLanguage() {
        return isoLanguage;
    }

    public void setIsoLanguage(String isoLanguage) {
        this.isoLanguage = isoLanguage;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public String getBaseNoFacesUrl() {
        return baseNoFacesUrl;
    }

    public void setBaseNoFacesUrl(String baseNoFacesUrl) {
        this.baseNoFacesUrl = baseNoFacesUrl;
    }

    public String getSkin0Culomns() {
        return skin0Culomns;
    }

    public void setSkin0Culomns(String skin0Culomns) {
        this.skin0Culomns = skin0Culomns;
    }

    public String getSkinPatch() {
        return skinPatch;
    }

    public void setSkinPatch(String skinPatch) {
        this.skinPatch = skinPatch;
    }

    public String getSkinUrl() {
        return skinUrl;
    }

    public void setSkinUrl(String skinUrl) {
        this.skinUrl = skinUrl;
    }

    public String getTplPatch() {
        return tplPatch;
    }

    public void setTplPatch(String tplPatch) {
        this.tplPatch = tplPatch;
    }

    public String getTplUrl() {
        return tplUrl;
    }

    public void setTplUrl(String tplUrl) {
        this.tplUrl = tplUrl;
    }

    public Collection<FacesMessage> getMessages() {
        return messages;
    }

    public MenuModel getMenuModel() {
        return menuModel;
    }

    public void setMenuModel(MenuModel menuModel) {
        this.menuModel = menuModel;
    }

    public String getCurrentUrl() {
        return currentUrl;
    }

    public void setCurrentUrl(String currentUrl) {
        this.currentUrl = currentUrl;
    }
    
}
